package edu.neu.swc.cloud.service.impl;

import edu.neu.swc.cloud.dao.CategoryDao;
import edu.neu.swc.cloud.domain.EquipCata;
import edu.neu.swc.cloud.domain.ProductCata;
import edu.neu.swc.cloud.service.CategoryService;
import org.apache.catalina.startup.Catalina;
import org.apache.ibatis.javassist.bytecode.DeprecatedAttribute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("categoryService")
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    CategoryDao categoryDao;

    @Override
    public List<EquipCata> findAllEqu() {
        return categoryDao.findAllEqu();
    }

    @Override
    public List<ProductCata> findAllPro() {
        return categoryDao.findAllPro();
    }

    @Override
    public void addProCate(ProductCata productCata) {
        categoryDao.addProCate(productCata);
    }

    @Override
    public void addEquipCate(EquipCata equipCata) {
        categoryDao.addEquipCate(equipCata);
    }

    @Override
    public void deleteEquCateById(int equ_ca_id) {
        categoryDao.deleteEquCateById(equ_ca_id);
    }

    @Override
    public void deleteProCateById(int pro_ca_id) {
        categoryDao.deleteProCateById(pro_ca_id);
    }

    @Override
    public void updateProCate(ProductCata cata) {
        categoryDao.updateProCate(cata);
    }

    @Override
    public void updateEquCate(EquipCata cata) {
        categoryDao.updateEquCate(cata);
    }

    @Override
    public EquipCata findEquCateById(int equ_ca_id) {
        return categoryDao.findEquCateById(equ_ca_id);
    }

    @Override
    public ProductCata findProCateById(int pro_ca_id) {
        return categoryDao.findProCateById(pro_ca_id);
    }

    @Override
    public List<EquipCata> findEquCateByCon(EquipCata equipCata) {
        return categoryDao.findEquCateByCon(equipCata);
    }

    @Override
    public List<ProductCata> findProCateByCon(ProductCata productCata) {
        return categoryDao.findProCateByCon(productCata);
    }

    @Override
    public int getProductTypeCounts(String pro_ca_name) {
        return categoryDao.getProductTypeCounts(pro_ca_name);
    }

    @Override
    public List<ProductCata> findProductTypeByQuery(String pro_ca_name, int pageStart, int pageSize) {
        return categoryDao.findProductTypeByQuery(pro_ca_name,pageStart,pageSize);
    }

    @Override
    public ProductCata findProCateByName(String pro_ca_name) {
        return categoryDao.findProCateByName(pro_ca_name);
    }

    @Override
    public int getEquipTypeCounts(String eq_ca_name) {
        return categoryDao.getEquipTypeCounts(eq_ca_name);
    }

    @Override
    public List<EquipCata> findEquipTypeByQuery(String eq_ca_name, int pageStart, int pageSize) {
        return categoryDao.findEquipTypeByQuery(eq_ca_name,pageStart,pageSize);
    }

    @Override
    public EquipCata findEquCateByName(String eq_ca_name) {
        return categoryDao.findEquCateByName(eq_ca_name);
    }
}
